﻿<%@ Page Language="C#" AutoEventWireup="true" Codebehind="upload.aspx.cs" Inherits="JumbotCms.WebFile.Admin.Cut2Thumb._upload" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>上传</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="../../_data/SysConfig.js"></script>
<script type="text/javascript" src="../../_libs/jquery-min.js"></script>
<script type="text/javascript" src="../../scripts/jumbotcms.js?v4"></script>
<link type="text/css" rel="stylesheet" href="../../style/global.css" />
<script type="text/javascript" src="../../_libs/jquery.ajaxfileupload.js"></script>
<style type="text/css">
*{ margin:0; padding:0; }
body {margin: 0px;padding: 0; font-size: 12px; background-color: #FFFFFF;color: #333333;}
td,input {font-size: 12px;}
</style>
<script type="text/javascript">
	function ajaxFileUpload()
	{
		$("#buttonUpload")
		.ajaxStart(function(){
			$(this).hide();
			JumbotCms.Loading.show("正在上传...");
		})
		.ajaxComplete(function(){
			$(this).show();
		});

		$.ajaxFileUpload
		(
			{
				url:"upfile.aspx?ccid=<%=q("ccid")%>&ThumbSize="+$("#ThumbSize").val()+"&CutType="+$("#CutType").val(),
				secureuri:false,
				fileElementId:'fileToUpload',
				dataType: 'json',
				success: function (data, status)
				{
					if(data.result != '1')
					{
						JumbotCms.Alert(data.returnval, "0");
					}else
					{
						window.location=data.returnval;
					}
				},
				error: function (data, status, e)
				{
					JumbotCms.Loading.hide();
					alert(e);
				}
			}
		)
		
		return false;

	}
	</script>
</head>
<body>
<form id="frmUpload" runat="server" method="post" enctype="multipart/form-data">
	<table id="UploadDiv" runat="server" style="width:100%;">
		<tr>
			<td><asp:DropDownList ID="ThumbSize" runat="server"> </asp:DropDownList>
				<asp:DropDownList ID="CutType" runat="server">
					<asp:ListItem Selected="True" Value="0">自动缩放</asp:ListItem>
					<asp:ListItem Value="1">手工裁剪</asp:ListItem>
				</asp:DropDownList>
				<asp:FileUpload ID="fileToUpload" runat="server" Width="320" />
				<input type="button" id="buttonUpload" onClick="return ajaxFileUpload();" value="上传" /></td>
				</tr>
	</table>
</form>
</body>
</html>
